<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>t_look</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4>NAME</h4><blockquote>
t_look - look at the current event on a transport endpoint
</blockquote><h4>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="xti.h.html">xti.h</a>&gt;

int t_look(
    int fd)
</code>
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote>
<pre>
<P><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Parameters</b>
<th align=center><b>Before call</b>
<th align=center><b>After call</b>
<tr valign=top><td align=left>fd
<td align=center>x
<td align=center>/
</table>
</pre>
<p>
This function returns the current event on the transport endpoint
specified by
<I>fd</I>.
This function enables a transport provider to notify a transport user of
an asynchronous event when the user is calling functions in synchronous
mode.
Certain events require immediate notification of the user and are indicated
by a specific error, [TLOOK], on the current or next function to be
executed. Details on events which cause functions to fail [TLOOK] may be
found in
<xref href=etleind></xref>.
<p>
This function also enables a transport user to poll a
transport endpoint periodically for asynchronous events.
</blockquote><h4>VALID STATES</h4><blockquote>
ALL - apart from T_UNINIT
</blockquote><h4>ERRORS</h4><blockquote>
On failure,
<I>t_errno</I>
is set to one of the following:
<dl compact>

<dt>[TBADF]<dd>The specified file descriptor does not refer to a transport endpoint.

<dt>[TPROTO]<dd>This error indicates that a communication problem has been detected between
XTI and the transport provider for which there is no other suitable XTI
error
<I>(t_errno)</I>.

<dt>[TSYSERR]<dd>A system error has occurred during execution of this function.

</dl>
</blockquote><h4>RETURN VALUE</h4><blockquote>
Upon success,
<i>t_look()</i>
returns a value that indicates which of the allowable
events has occurred, or returns zero if no event exists.
One of the following events is returned:
<dl compact>

<dt>T_LISTEN<dd>Connection indication received.

<dt>T_CONNECT<dd>Connect confirmation received.

<dt>T_DATA<dd>Normal data received.

<dt>T_EXDATA<dd>Expedited data received.

<dt>T_DISCONNECT<dd>Disconnection received.

<dt>T_UDERR<dd>Datagram error indication.

<dt>T_ORDREL<dd>Orderly release indication.

<dt>T_GODATA<dd>Flow control restrictions on normal data flow that led to a [TFLOW]
error have been lifted.
Normal data may be sent again.

<dt>T_GOEXDATA<dd>Flow control restrictions on expedited data flow that led to a [TFLOW]
error have been lifted.
Expedited data may be sent again.

</dl>
<p>
On failure, -1 is returned and
<I>t_errno</I>
is set to indicate the error.
</blockquote><h4>SEE ALSO</h4><blockquote>
<i><a href="t_open.html">t_open()</a></i>,
<i><a href="t_snd.html">t_snd()</a></i>,
<i><a href="t_sndudata.html">t_sndudata()</a></i>.
</blockquote><h4>APPLICATION USAGE</h4><blockquote>
Additional functionality is provided through the
Event Management (EM) interface.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
